<?php  
class ConfigController extends AuthController{
	private $db;
	/**
	 * 构造函数
	 * @return [type] [description]
	 */
	public function __init(){
		
		$this->db=K('Config');//配置项模型
	}
	public function index(){
		$this->display();
	}
	/**
	 * 网站配置项管理
	 * @return [type] [description]
	 */
	public function manage(){
		if (IS_POST) {
			if ($this->db->setConfig()) {

				$this->success("操作成功");	

			}else{

				$this->error($this->db->error);
				
			}
		}else{
			//获取所有配置项
			$config=$this->db->get();
			//分配配置项
			$this->assign('config',$config);

			$this->display();
		}
	}
}
?>